package test.enums;

/**
 * @author zhenjie.Ji
 * @description 数字钥匙车端新报文结构枚举类
 * @date 2025/1/14 13:35
 */
public enum VehicleProtocolEnum {
    /**
     * 上传车端密钥数据接口
     */
    VEHICLE_KEY_UPLOAD("71", "http://127.0.0.1:9002/v1/dkms/key/uploadvehiclekey", ""),
    /**
     * 获取车端密钥数据接口
     */
    VEHICLE_KEY_DOWNLOAD("", "", ""),
    /**
     * 获取钥匙黑名单接口
     */
    VEHICLE_GET_DK_BLACK("", "", ""),
    /**
     * 上传推送消息结果接口
     */
    VEHICLE_MSG_RESULT("", "", ""),
    /**
     * 密钥更新接口
     */
    VEHICLE_KEY_UPDATE("", "", ""),
    /**
     * 未知情况
     */
    UNKNOWN("", "", "");
    /**
     * 请求编码
     */
    private String requestCode;
    /**
     * 请求地址
     */
    private String requestUrl;
    /**
     * 响应编码
     */
    private String responseCode;

    VehicleProtocolEnum(String requestCode, String requestUrl, String responseCode) {
        this.requestCode = requestCode;
        this.requestUrl = requestUrl;
        this.responseCode = responseCode;
    }

    public static VehicleProtocolEnum getByCode(String code) {
        for (VehicleProtocolEnum vehicleProtocolEnum : VehicleProtocolEnum.values()) {
            if (vehicleProtocolEnum.getRequestCode().equals(code)) {
                return vehicleProtocolEnum;
            }
        }
        return UNKNOWN;
    }

    public String getRequestCode() {
        return requestCode;
    }

    public void setRequestCode(String requestCode) {
        this.requestCode = requestCode;
    }

    public String getRequestUrl() {
        return requestUrl;
    }

    public void setRequestUrl(String requestUrl) {
        this.requestUrl = requestUrl;
    }

    public String getResponseCode() {
        return responseCode;
    }

    public void setResponseCode(String responseCode) {
        this.responseCode = responseCode;
    }
}
